<?php
/**
 * 日志记录
 * @author Yangdong Zhang <zhangyangdong@gouuse.cn>
 * @time 2018/10/24 14:50
 */

namespace App\Util;

class Logs
{
    /**
     * 添加日志
     * @param $data
     * @param $title
     */
    public static function info($title, $data)
    {
        $file    = RUNTIME.'/logs/'.date('Ymd').'.log';
        $content = date('Y-m-d H:i:s').": ".$title.': '.json_encode($data, JSON_UNESCAPED_UNICODE).PHP_EOL;
        file_put_contents($file, $content, FILE_APPEND);
    }
}